home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 84 / diox.doc < prev    next >
Text File  |  1987-08-16  |  47KB  |  889 lines

  1.  
  2.                            DIOX version 0.95
  3.                             Copyright 1987
  4.                           by Paul Huntington
  5.                            ----------------
  6.      
  7.      A complete DIOX system should have the following ...
  8.                
  9.                DIOXMH95.PRG   ---------> The program itself
  10.                                          (med/hi res, v0.95)     
  11.                DIOX.DOC   -------------> This documentation
  12.                DRAW_BTN.LST  ----------> Procedure to be merged
  13.                BOXTEST.BAS   ----------> The dialog box tester
  14.                
  15.      Plus an example ------------------------------------------     
  16.                EXAMPLE.DAT/.DSH -------> Exmples to create with
  17.                EXAMPLE.LST  -----------> Example dialog box
  18.      
  19.      (Part 1)
  20.      INTRODUCTION:                    
  21.      ---------------------------------------------------------
  22.           The purpose of DIOX is to allow the GFA BASIC programmer 
  23.      to quickly and easily create and edit dialog boxes. It 
  24.      will do this by allowing the programmer to visually place 
  25.      and edit the various dialog box buttons, choose thier 
  26.      'properties' and then generate the actual source code to 
  27.      implement the dialog box. My goal is to eliminate the chore 
  28.      of writing user interfaces so that programmers can 
  29.      concentrate on writting JUST thier applications. No time 
  30.      should be spent on user interface mechanics, instead most of 
  31.      the time should be spent on user interface layout and 
  32.      proccessing the data in a programmers application. Will DIOX 
  33.      accomplish this for you? In my opinion, it should. BUT YOUR 
  34.      OPINION IS WHAT DETERMINES IF DIOX WILL DO ANY GOOD FOR YOU, 
  35.      NOT MY OPINION! What that means is, if for any reason, any 
  36.      version of DIOX won't do a job you're using it for in any 
  37.      particular way, manner, or form, THAT IS NOT MY LIABILTY, IT 
  38.      IS YOURS. IF DIOX screws you up due to a bug, or any other 
  39.      shortcomming, then YOUR the one who got screwed up, not ME, 
  40.      because I'm not legaly responsible for your use of DIOX. I 
  41.      do feel morally responsible for DIOX itself, so I plan to  
  42.      to support it. Your use of it is up to you. In case 
  43.      you didn't recognize what I've just said, it is called a 
  44.      'WARRANTY DISCLAIMER', only this is in plain English. I've 
  45.      taken every step I know to insure that DIOX is reliable and 
  46.      bug free, but nothing is ever perfect. 
  47.      
  48.           Version 0.95 has everything I wanted to add EXCEPT 
  49.      EDITABLE BUTTONS. DIOX v1.0 will have editable buttons! 
  50.      This present version will allow you to graphically layout, 
  51.      edit, save, and load an entire dialog box at a time. You can
  52.      have RADIO, TOGGLE, and EXIT buttons in your box. You can 
  53.      also have one ENTER and one CANCEL button for each box. More
  54.      on those two shortly. DIOX will work in ALL resolutions.
  55.                
  56.      FILES FOR DIOX  v 0.95 :
  57.           
  58.           DIOX.PRG is DIOX itself. DIOX v 0.95 is 238,508 bytes of 
  59.      pure, 100%, GFA BASIC, compiled with version 1.8 (US) GFA 
  60.      Compiler. The source code will be uploaded to various BBSs 
  61.      if there is a whopping demand for it.
  62.  
  63.           DRAW_BTN.LST is to be merged in with your GFA program. 
  64.      You need not know how it works (read the TEST_BOX.BAS listing 
  65.      if you're curious about it). The DRAW_BTN.LST file is a 
  66.      procedure which draws a line of text centered in an optional 
  67.      box frame. ALL DIOX DIALOG BOXES CALL THIS! Just merge it 
  68.      and forget it. The DRAW_BTN.LST file with DIOX v0.95 is 
  69.      DIFFERENT from the one with v 0.90. USE v0.95s' instead 
  70.      of 0.90s'. It will be compatible with any DIOX v0.90 buttons.
  71.  
  72.           DIOX.DOC is, of course, this documentation to DIOX. 
  73.      It is divided into THREE parts :
  74.                     1) Introduction
  75.                     2) "EDITING" tutorial to get you quickly into 
  76.                        editing dialog boxes
  77.                     3) "INTERFACING" explains how to interface
  78.                        your new dialog box into your program.
  79.      
  80.           BOXTEST.BAS is a short program to test any dialog box 
  81.      that you make. Merge in your dialog box ".LST" file that you 
  82.      generated with DIOX, rename the 'Yourbox' in the listing on 
  83.      one of the first few lines to your own boxes' name, then run 
  84.      it. 
  85.      
  86.      
  87.      
  88.      (PART 2)
  89.      EDITING :     
  90.      ---------------------------------------------------------     
  91.           You start out with DIOX by selecting 'Create'(Unless you 
  92.      have a file to load off disk). The program wants a procedure 
  93.      name for the button. Use up to 32 characters of the type that 
  94.      would normally be allowed in a GFA BASIC PROCEDURE NAME. That 
  95.      means only uppercase-alpha, lowercase-alpha, digits 0-9, and 
  96.      the underscore " _ " character. If an ENTRY ERROR is made an 
  97.      alert box will come up. If this happens, clicking 'OK' will 
  98.      send you back to edit your response, and clicking 'Cancel' 
  99.      will abort the creation. When finished entering the ITEMS 
  100.      NAME, you may wish to jot it down if you think you can't 
  101.      remember it. This will be important to you as you use it in 
  102.      your program, as this is the name that will be passed back 
  103.      to you if the button is clicked on during your programs' run.
  104.           
  105.           Next you may want to select STRING under the TEXT 
  106.      heading. This allows you to type in the line of characters 
  107.      that will be in the button . NOTE: DON'T USE THE DOUBLE QUOTE 
  108.      CHARACTER (")! DIOX will check for this error. You may use 
  109.      any of the non-keyboard characters by typing CTRL-A, the 
  110.      ASCII code of the character you want (in your GFA manual), 
  111.      and a cursor key. The special character you want should be 
  112.      visible then. For instance, to get an UP ARROW symbol, type:
  113.      
  114.                     CTRL-A, 1, then any CURSOR KEY.
  115.                
  116.      You are allowed 70 characters for medium or high res, 35 for 
  117.      low res. 
  118.      
  119.           To create a border simply press '+' and keep pressing 
  120.      it until the border is as thick as you want. If you want to 
  121.      reduce the border thickness, press '-' until the border is 
  122.      as thin as you want it. You can keep doing this until the 
  123.      border is gone. Your buttons don't HAVE to have borders. If 
  124.      you are making an AUTORES box and are doing it from MONO, 
  125.      you may wish to make a default buttons' thickness a little 
  126.      thicker than normal, as auto res cuts thickness in half on 
  127.      medium res from its' original MONO size. That's so it can 
  128.      squeeze evrything onto a medium res screen. To increase the 
  129.      size of the box area, press CURSOR UP for increased vertical 
  130.      size and press cursor right for increased horizontal size. 
  131.      CURSOR DOWN decreases vertical border size and CURSOR LEFT 
  132.      reduces horizontal border size. 
  133.      
  134.           To actually move the button, place the arrow on top of 
  135.      the button, click the RIGHT MOUSE BUTTON, and move the mouse. 
  136.      Note that the arrow disappears. This picks up the button so 
  137.      that it moves with your mouse movements. This also ACTIVATES 
  138.      the button. ACTIVE means that the button is now the present 
  139.      button being worked on, and so whatever text, border, or 
  140.      attribute changes you make will be made to the ACTIVE button. 
  141.      To lay down the button, click the LEFT MOUSE BUTTON. You may 
  142.      need to click it twice, as GFA BASIC seems to miss a click 
  143.      occasionaly, but usually once is enough. The +, - and cursor 
  144.      keys will work either when the button your working on is 
  145.      being moved or when the button is layed down. 
  146.                                                                   
  147.                Now you know how to CREATE your first button, 
  148.      make its' TEXT, create its' BORDER, MOVE and PLACE it, and 
  149.      ACTIVATE it for further editing at any time. You can also 
  150.      change its' text SYTLE, SIZE (not in AUTORES), COLOR (not in 
  151.      AUTORES or MONO), choose weather you want to have it drawn in 
  152.      reverse or not by using the SELECTED option, (RADIO and 
  153.      TOGGLE buttons will not be effected by this in the final, 
  154.      generated code. You pre-set these by a PROCEDURE call, more 
  155.      on that later), and choose what ATTRIBUTE it has. ATTRIBUTES 
  156.      are what the buttons do when they are selected. Let's talk 
  157.      about ATTRIBUTES.
  158.      
  159.           DIOX has SIX ATTRIBUTES in its' Attr menu strip. RADIO, 
  160.      TOGGLE, EXIT, DEAD, ENTER, and CANCEL. 
  161.      
  162.      RADIO:
  163.           RADIO is when you have a group of buttons, but only ONE 
  164.      button can be selected at a time. A "set RS 232 port" dialog 
  165.      box prbably uses a group of radio boxes to set the baud rate, 
  166.      as you can only choose a single baud rate out of several 
  167.      choices. DIOX allows FIVE distinct groups of radio boxes. 
  168.      When you want a button to be a radio button, just select the 
  169.      RADIO option. A dialog box will appear with five buttons 
  170.      labeled "Group 1", "Group 2", "Group 3", "Group 4", and 
  171.      "Group 5". It also has an OK and a cancel button. Select one 
  172.      of those groups and then hit Return or click on OK. Cancel 
  173.      simply aborts any changes. Now, when you see the Attr strip 
  174.      scroll down again, you'll see RADIO's  been checked. The 
  175.      buttons' attribute is now set. 
  176.      
  177.      TOGGLE:
  178.           Or, maybe you'd rather have it as a TOGGLE button 
  179.      instead. Simply select the TOGGLE option. It will be checked 
  180.      when selected. A toggle button will simply reverse its' state 
  181.      when it's been selected. So if the button is in a turned-off 
  182.      state, it will turn on (reverse) when clicked on. If it is in 
  183.      a turned-on state, it will be turned off when selected. 
  184.      
  185.           RADIO and TOGGLE are the only two button types that are 
  186.      pre-selectable from your eventual program (via what variable 
  187.      you pass to it in your procedure call- more on that later), 
  188.      they are NOT presetable from DIOX even though you can reverse 
  189.      them there.
  190.      
  191.      EXIT:
  192.           EXIT buttons are also available. Again, just click on 
  193.      that option to make your button an exit button. An exit 
  194.      button will cause an exit from the dialog box when selected. 
  195.      First, though, it will reverse for a moment, just to look 
  196.      like it has been selected. 
  197.      
  198.      DEAD:
  199.           DEAD is the default when DIOX first starts up. A dead 
  200.      button does absolutly nothing when selected. It is for a 
  201.      display only. Most of the text in the help screens of DIOX 
  202.      are dead buttons. 
  203.      
  204.      ENTER:
  205.           A button given the ENTER attribute is the only DEFAULT 
  206.      button DIOX gives you. By DEAFULT I mean that it will be the 
  207.      button selected when RETURN is pressed. It can also be 
  208.      selected in the usual way with the mouse. When an enter 
  209.      button in your dialog box is selected, the dialog box is 
  210.      exited with the newly selected settings of the other buttons 
  211.      passed back to the main program. Don't worry if you don't 
  212.      understand 'passed back', I'll explain that shortly. 
  213.      
  214.      CANCEL:
  215.           A CANCEL button, like ENTER and EXIT, will cause an exit 
  216.      from the routine if it is selected in your programs' dialog 
  217.      box. However, a CANCEL button will cause any of the new 
  218.      button settings to be disregarded and will pass back the old 
  219.      button settings you went in with. Another words, it will 
  220.      cancel any changes made to the dialog boxes' settings. 
  221.      
  222.           Niether CANCEL or ENTER will ever pass back thier own 
  223.      names. TOGGLE, RADIO, and EXIT buttons' names ARE passed back 
  224.      if they were selected.
  225.      
  226.           In summary, The RADIO attribute will cause only one out 
  227.      of a group to be selected. TOGGLE will always reverse the 
  228.      button when selected. EXIT will cause an exit from the dialog 
  229.      box with all new selections passed back. DEAD will do 
  230.      nothing. ENTER will cause an exit if either the return key is 
  231.      hit or it is selected by mouse, passing back all the new 
  232.      selections. CANCEL will exit the dialog box BUT passing back 
  233.      only the PRE-SET values you went in with, canceling all new 
  234.      selections.
  235.      
  236.           A tip on ENTER buttons. Generaly, you'd want to make 
  237.      thier borders thicker, as it is generally understood that 
  238.      thicker borders constitute default. Another note: You should 
  239.      use only ONE enter button per dialog box. DIOX will not 
  240.      restrict you to this, but I don't know what would happen if 
  241.      you put in two defaults.
  242.                    
  243.           Thus far, I have explained how to create a button, put 
  244.      text into it, make its' border, select size, style, and color 
  245.      of text, reverse a DEAD, CANCEL, or EXIT button from DIOX, 
  246.      and assign a button one of six attributes and what those 
  247.      attributes were. 
  248.      
  249.           Now you'd probably want more than one button in your 
  250.      box. So, simply select CREATE and start up another button. 
  251.      NEVER USE THE SAME NAME FOR DIFFERENT BUTTONS! DIOX will 
  252.      check for this. Since there was a previously active button, 
  253.      the name of the last button activated will be the default 
  254.      text in your edit space. You may only wish to change one 
  255.      character if you have a system of simular buttons, such names 
  256.      as Color_a, Color_b, or you can totaly re-enter a whole new 
  257.      name. If you enter the same name that was there before, NO 
  258.      NEW BUTTON IS CREATED. The creation is just aborted. ALL of 
  259.      the new buttons' properties default to the properties of the 
  260.      LAST ACTIVE BUTTON. You have to change those properties if 
  261.      you want a different looking and/or acting button. Changing 
  262.      an activated buttons' properties is just a matter of 
  263.      selecting the appropriate options, as before. Don't worry, 
  264.      you won't lose the properties of the last button, it was 
  265.      stored away when you made a new button and can be recalled by 
  266.      activating that button again.
  267.  
  268.           When all buttons, except the first, are created, they 
  269.      will already be picked up by your mouse. That is so they 
  270.      won't suddenly pop into existance on some other button. 
  271.      Simply take them to where you want to put them, and left-
  272.      click the mouse to put it down. 
  273.      
  274.           With more than one button on your screen, you must have 
  275.      a method of directing your text, style, attribute, etc 
  276.      changes to just the one button you're working on. This means 
  277.      you must ACTIVATE the button. You do this by placing the 
  278.      mouse arrow over the button. Then you can either click the 
  279.      right mouse button, which will always mean moving your 
  280.      button at least a few pixels, or you just can press return 
  281.      and not disturb its' position on the screen. Doing either one 
  282.      of these things says to DIOX " I want to work on THIS button 
  283.      now ". When you ACTIVATE a button all of that buttons' 
  284.      characteristics are now displayed in all the menus. The 
  285.      options of CREATE and RENAME( explained below ) will print 
  286.      the buttons' name out when they are selected. The TEXT and 
  287.      ATTR menu strip will display checks at all places which were 
  288.      last selected for THAT button. String option will print the 
  289.      buttons' text out as default when selected. The radios' 
  290.      dialog box will display a radio buttons' group number. This 
  291.      is how you go about getting a status report on a particular 
  292.      button you want to check. Just activate it, and look at all 
  293.      the menus and thier options. They all reflect the buttons' 
  294.      status. I had to use seperate drop down menus to display and 
  295.      set all the settings of a button ( except radio grouping ) 
  296.      because, guess what, I had no efficient method of making 
  297.      dialog boxes. DIOX 0.95 may be 'gutted' and re-fit with a 
  298.      single dialog box for making most of those drop-down menu 
  299.      options for version 1.0. I now have a dialog box editor to do 
  300.      that with.  
  301.      
  302.           To DELETE a button, ACTIVATE the offending button and 
  303.      press DELETE. The PRESENTLY ACTIVE BUTTON will be gone 
  304.      forever. If you kept pressing DELETE after that, the 
  305.      previously created button from the one just deleted will be, 
  306.      you guessed it, deleted. It keeps going back to the first 
  307.      button.
  308.      
  309.           RENAME is another option you may need. If you wanted to, 
  310.      you could just change the name of a button without creating a 
  311.      new one by selecting this option.  
  312.      
  313.           Also, two new additions to v0.95 are ROUNDED and SEE 
  314.      THRU options. Rounded will cause the buttons' border to have 
  315.      rounded edges. See thru will cause the buttons' background to 
  316.      be transparent. When reversed, anything under it will be 
  317.      reversed. This is usefull for puttings several lines of text 
  318.      under a single button. I am planning on putting a clip-art 
  319.      option onto DIOX, so pictures can be under this button as 
  320.      well as text. 
  321.      
  322.           What have you learned? By now you should know ....
  323.      
  324.                How to CREATE your first button
  325.                How to make TEXT for your button
  326.                How to change the STYLE, SIZE, and COLOR of text
  327.                How to edit the text in your button
  328.                How to add a border line around your button
  329.                How to make the border line THICKER or THINNER
  330.                How to make the border AREA larger or smaller
  331.                How to assign an ATTRIBUTE to a button
  332.                How to MOVE your button and PLACE IT somewhere
  333.                How to CREATE MORE buttons 
  334.                How to ACTIVATE any particular button 
  335.                How to change the SETTINGS of any button, any time
  336.                How to RENAME a button
  337.                How to DELETE a button
  338.                How to make ROUNDED buttons
  339.                How to make TRANSPARENT buttons
  340.      
  341.           You now know how to make, edit, and manipulate buttons, 
  342.      I hope. If not, PLAY-PLAY-PLAY with DIOX! Look at the example 
  343.      given in this text. READ the HELP screens in DIOX (press 
  344.      HELP). 
  345.      
  346.           OKAY, let's move on to some artistic detailing. You've
  347.      completed all your buttons and laid them down nicely right 
  348.      next to each other in neat little rows (unless your into 
  349.      'new-wave' dialog boxes). Now you may wish to enclose your 
  350.      buttons in a box, to graphically seperate them from the rest 
  351.      of the screen. Just select the BOX option. This is 
  352.      different from the older v0.90 version of DIOX. Now you 
  353.      select a fill pattern for the box first. It can be any one of 
  354.      36 patterns, solid white, or transparent (a frame). Click on 
  355.      this with the left mouse button. The box is now started by 
  356.      placing the cross on a point where one corner of the square 
  357.      is to go. Then click the RIGHT mouse button. Move the mouse 
  358.      around until the frame is the desired shape. Click the LEFT 
  359.      mouse button to lay down the square. To delete any shape, 
  360.      press UNDO and the last shape drawn (not nessesarily the 
  361.      last created because of the bottom option) will be deleted. 
  362.  
  363.           Let's again review what should now have been learned. 
  364.      Do you know how to use DIOX to do all kinds of things to all 
  365.      kinds of buttons, including making a button go away? I 
  366.      explained how up there. How about making shapes to enhance 
  367.      the appearance of your box? You know how to make shapes go 
  368.      away too, right? GOOD! Now we move on to our final 
  369.      destination. GENERATING THE CODE THAT WILL DO ALL THIS!
  370.      
  371.           The SAVE option starts all this 'program generating' 
  372.      up. When all is well with what you've laid out, you'll want 
  373.      to select SAVE. The first thing that pops up is a request to 
  374.      enter the dialog boxes name. Again, same as the BUTTONS' 
  375.      name, a procedure name. IT MUST BE DIFFERENT FROM ANY OTHER 
  376.      NAME USED IN YOUR BOX. Same as the BUTTONS' NAME rules. It 
  377.      will be checked for uniqueness by DIOX. This is the name you 
  378.      will use to call your box from your procedure. Once you've 
  379.      selected the name and pressed return, a SAVE OPTIONS menu 
  380.      will come up. You can choose to save only the DIALOG BOX 
  381.      DATA, or to just generate a LST file (your dialog box 
  382.      routine), or BOTH. Another option is to make your dialog box 
  383.      RESTORE THE SCREEN AFTER EXIT. A REPORT can be sent to the 
  384.      printer. This will list the dialog boxes' procedure name, and 
  385.      each individual buttons' name, text line, and attribute. I 
  386.      havn't put in a printer check routine, so have everything 
  387.      ready for this. You can get JUST a report without saving by 
  388.      selecting this then selecting cancel at the forthcomming file 
  389.      selector box. The last item is the BUTTON DELAY. This 
  390.      controls how fast the dialog box reacts to your clicking of 
  391.      the mouse button. It defaults to 4. 0 is fastest, 9 is 
  392.      slowest. Select OKAY when done. Now a file selector box will 
  393.      appear. It wants a name to save your .LST file which is the 
  394.      code for your dialog box. Make sure you type in that .LST 
  395.      extender, as DIOX will not add it. When you press return, 
  396.      DIOX starts churning away. The new 0.95 version will now 
  397.      write code to the screen as well as disk, so you see it as 
  398.      it's being written. DIOX will also comment on every new 
  399.      procedure as it creates it. It can be a show. It takes a few 
  400.      seconds to a few minutes to generate a dialog box routine, 
  401.      depending on its' complexity. When the thing stops, you'll 
  402.      know it, as the picture redraws itself and the bee has turned 
  403.      back into an arrow. WARNING! WARNING! I have NOT used traps 
  404.      in DIOX. If you forget to place a disk into the drive or some 
  405.      other catastrophe occours, THE PROGRAM WILL TERMINATE! And 
  406.      your work along with it. Make sure all is well BEFORE using 
  407.      DIOX. OH, before I forget, two other files are laid down 
  408.      besides your .LST file. A .DAT file is the raw data on the 
  409.      dialog box and each of the buttons. A .DSH file is the data 
  410.      on the shapes in your box. THESE ARE WHAT IS LOADED BACK IN 
  411.      FOR FURTHER EDITING. So, now that we have generated a routine 
  412.      that is supposed to implement your design, let's not go right 
  413.      into testing it. First let's cover our last feature, LOADING.
  414.      
  415.           To LOAD in a previously SAVEd dialog box, hit ESC. This 
  416.      will CLEAR and RESTART the whole program. Now, select the 
  417.      LOAD option. The file selector will come up with the name of 
  418.      the .DAT files on your directory. It wants to load the .DAT 
  419.      and .DSH files that were previously laid down from SAVE. It 
  420.      doesn't care about the .LST file. Once loaded, your started 
  421.      with the first, created button as your active button. Your 
  422.      ready to continue editing using all the above described 
  423.      features. NOTE! If you load in a file created with DIOX 
  424.      0.90 into DIOX 0.95, and it had FILL patterns in it, they 
  425.      will not show up. Erase all shapes and start them over again 
  426.      with v0.95s superior method. Remeber, the old fills won't 
  427.      show up, so when deleting, hit UNDO twice. You won't hurt 
  428.      anything by UNDOing too many times. I have kept the BUTTON 
  429.      compatibilty with 0.90 flawless, despite the two new button 
  430.      features (rounded and see thru).
  431.  
  432.      
  433.      (PART 3)
  434.      INTERFACING
  435.      -------------------------------------------------------
  436.           So, I assume you have a generated .LST file you'd like 
  437.      to quickly put into a program and test. The program called 
  438.      TEST_BOX.BAS will to just that. It has instructions in its' 
  439.      listing for merging it in and testing it. I'll explain it 
  440.      here:
  441.      
  442.           Step 1) MERGE your dialog box program into TEST_BOX.BAS 
  443.      either where the listing says you should or in the end of it. 
  444.      Just be sure you don't merge it in the middle of the only 
  445.      other procedure in there, the DRAW_TEXT_IN_BOX procedure. GFA 
  446.      BASIC will not allow procedures within procedures. 
  447.      
  448.           Step 2) RENAME the Procedure call, @Your_box_name, to
  449.      your boxes actual name. It is on the first few lines of 
  450.      TEST_BOX.BAS.
  451.      
  452.           Step 3) RUN IT!
  453.      
  454.           Notice, everytime you select a box you made into an exit 
  455.      box, an enter box, or a cancel box, your box disappears and 
  456.      some names appear inside parentheses, along with other 
  457.      parentheses which are empty. Do some of those names look 
  458.      familiar? Those are the names you assigned to those buttons. 
  459.      When ever a TOGGLE, RADIO, or EXIT box is selected, thier 
  460.      names are passed back between parentheses in one string. Now 
  461.      hit a key. Your dialog box will come back, with the 
  462.      previously selected toggle and radio boxes now pre-selected. 
  463.      Your previous choices were 'echoed' back so you could see 
  464.      that all aspects of the dialog box work. To stop, just press 
  465.      CTRL-SHIFT-ATL as usual. You have now tested your box. Don't 
  466.      bother saving what you've got here. Your goal is to merge it 
  467.      into YOUR program, not the test shell.
  468.      
  469.           Now that you've tested it successfully (I hope), let's 
  470.      talk about INTERFACING it to your program. Figure 1
  471.      illustrates a flow chart of how the box is linked to your 
  472.      program and a little of how your box will work.
  473.      
  474.           The statement you must make to call your dialog box is
  475.      a simple, one line affair. NOTE: YOU must clear the screen 
  476.      before AND after the box is drawn. Maybe save a screen 
  477.      temporarily using SGET and then doing a CLS. Call your box.
  478.      When it's finished, use SPUT. I have elected NOT to do this 
  479.      from within a DIOX procedure as it would cut down on the 
  480.      ability of more advanced effects, like thumbwheels perhaps.
  481.      DIOXS' DIALOG BOXES WILL NOT ERASE ANYTHING. THEY DRAW IT AND
  482.      LEAVE IT! The before and after of the dailog box is up to 
  483.      you. You make a GOSUB call (I prefer @) with only two strings 
  484.      in the parameter list (parameter list is the part in the 
  485.      parentheses next to the GOSUB statement. They are seperated 
  486.      by a comma. See GFA MANUAL for more info.) 
  487.      
  488.           The first string is the PRESELECT. This string YOU 
  489.      provide. It can be an empty string if you like, a "" can be 
  490.      put there. If this is the case, none of the toggle or radio 
  491.      buttons will be preselected. Or, if you choose to preselect, 
  492.      simply take the name of the toggle or radio button you typed 
  493.      in when you CREATED it from DIOX, surround it with 
  494.      parentheses, (Like_this), and attatch it to the string. The 
  495.      toggle and radio buttons you specified will then start out in 
  496.      a selected state for default selections. You COULD specify 
  497.      more than one radio button per group be preselected, but then 
  498.      that radio group acts 'wierd', so you'd want to make sure 
  499.      your specifying no more than one radio button per group. 
  500.      Common sense.
  501.      
  502.           The second string, the POST-SELECT, must always be a 
  503.      VARIABLE preceded by an asterisk (*) character. That makes 
  504.      that variable a RETURN variable. A return variable is one 
  505.      which is changed by the procedure. YOU provide the string 
  506.      variables' NAME, and the DIALOG BOX will provide the string 
  507.      varibables' CONTENTS. After you've called the dialog box and 
  508.      it has returned (finished, been exited from), you can now 
  509.      use that returned preselect variable as the method of seeing 
  510.      what selections were made on the dialog box. It's format will 
  511.      be exactly the same as the preselects' variable except that 
  512.      it will have an EXIT button name if an EXIT button was 
  513.      chosen. How do you test if a particular name is in your 
  514.      postselect string? Use the INSTR function. The GFA manual 
  515.      has more info on this function, but basically you'd do 
  516.      something like : 
  517.                IF INSTR(Postselect$, "(Buttons_name)")>0 
  518.                  YUP! That button was selected
  519.                ELSE 
  520.                  NOPE! That button was not selected
  521.                ENDIF
  522.      
  523.      
  524.      
  525.      CONCLUSION --------------------------------------------
  526.                  Well, did I cover everything on DIOX? 
  527.                     I probably forgot some things. 
  528.       If you run into trouble, leave me EMAIL at GEnie where my 
  529.      address is PHUNTINGTON or on MICHTRONS' Sig there. OR, some 
  530.      local (San Diego, Ca.) BBSs I haunt are MIDI (619)452-7535 24 
  531.      hours/7 days 1200/2400. SDACE (619)284-3821 24hr/7days 1200/ 
  532.      hopefully 2400 soon. My address is also on the Intro screen 
  533.      of DIOX. Good luck.
  534.      
  535.       -------- Paul Huntington
  536.      
  537.      
  538.      
  539.      
  540.      
  541.      
  542.      
  543.      
  544.      
  545.      
  546.      
  547.      
  548.      
  549.      
  550.                |                  (FIGURE 1)
  551.                |                   
  552.            your program                               
  553.                |
  554.                |                  Passing
  555.              \ | /                preset names for
  556.               \ /                 radio & toggle. 
  557.      Gosub Your_boxes_name -------------------------> Now your                  
  558.                |<----------\                      dialog box is
  559.                |           |                      in control.
  560.        continue with your  |                            |
  561.             program        |                          \ | /
  562.                |           |              /----------> \ / 
  563.              \ | /         |              |      If a button is
  564.               \|/          |              |      selected, is it a
  565.                            |              |      EXIT,ENTER,or 
  566.                            |              |      cancel button?
  567.                         Passing back      |             |
  568.                      names of buttons     \------ NOPE, loop again
  569.                      de-limited, or                     |
  570.                      seperated by,                      |
  571.                      parentheses.                       |
  572.                            |                            |
  573.                            ----Send back NEW----- YES, ENTER/EXIT
  574.                           /|\  selected exit,           |
  575.                            |   toggle & radio names     |
  576.                            |                            |
  577.                            \---Send back OLD----- YES, CANCEL
  578.                                Preset radio, toggle
  579.                                button names that
  580.                                were sent IN. No changes.
  581.      
  582.      
  583.      
  584.      -----------------------------------------------------------
  585.      
  586.      
  587.      Let's step through an example on how to construct a dialog 
  588.      box. First load up the BOXTEST.BAS file. We're going to see 
  589.      an example which I have previously done. We are going to see 
  590.      how it works when in action. We want to this this first 
  591.      because you are going to build up an identical box, and you 
  592.      probably want to see what it SUPPOSED to do and look like. 
  593.      Now that you are in the BOXTEST.BAS program, merge in the 
  594.      EXAMPLE.LST file into an appropriate spot. A few lines from 
  595.      the top of the program you'll notice a statement 
  596.      
  597.                @Yourbox (Preset$,*Postset$)
  598.      
  599.      rename that statement to
  600.  
  601.                @Exmple_box (Preselect$,*Postselect$)
  602.      
  603.      and now run the program and the dialog box should appear in 
  604.      the upper half of the screen. This is a self-adjusting 
  605.      AutoRes dialog box. It will appear the same in mono or medium 
  606.      res color. Now twidle with everything and see what it does. 
  607.      Note that when the EXIT buttons, Cancel button, and Okay 
  608.      button is clicked on, the box exits as your choices are 
  609.      printed out. Ok, now you know what you've got to make. So 
  610.      let's do it.
  611.      
  612.           Load and run DIOX.PRG. Press return if you've already 
  613.      read the title screen. In medium or High res, an alert box 
  614.      will come up and ask if you want your box to automatically 
  615.      adjust to medium and hi res. Select YES. Now, select the load 
  616.      option and let's take a look at our initial example. Load in 
  617.      the EXAMPLE.DAT file. If your operating with a color monitor 
  618.      in medium resolution, look at what happens to this dialog 
  619.      box! It is not the same thing as you saw on the demo! 
  620.      Although everything fits onto the screen, it covers both 
  621.      halves. That is because AutoRes only effects the LST file 
  622.      which DIOX generates, NOT the actual data of the .DAT or .DSH 
  623.      files, nor will its' draw routines adjust more than the SIZE 
  624.      of the fonts. No matter. It still is editable. But we don't 
  625.      want to edit this. We want to MAKE this. So we will start 
  626.      over by pressing ESCAPE. Then press return. Then select YES 
  627.      to AutoRes again.
  628.      
  629.           Now, let's CREATE our first button. Select the create 
  630.      option from underneath the 'Item' drop down menu. It asks for 
  631.      an ITEMS procedure name. That should actually be BUTTONS 
  632.      procedure name, but DIOX is out already, so I'll correct that 
  633.      next time. So now we enter "RADIO_A_1" and return. Nothing 
  634.      should appear to happen on the screen. 
  635.           
  636.           We need to make the buttons' TEXT, so select the STRING 
  637.      option from the 'Text' drop down. Now it wants a String of 
  638.      characters for your button. Enter "Radio A 1" and return. Now 
  639.      you should see a line of text on the screen as "Radio A 1". 
  640.      You've just typed it in. 
  641.  
  642.           Pick up the button and move it twoards the right side of 
  643.      the screen. You do that by placing the mouse arrow over the 
  644.      button. Press the RIGHT mouse button for a moment. Now the 
  645.      arrow will be gone and the button moves with the mouse. place 
  646.      it where you previously saw the same "Radio A 1" button in 
  647.      the example (on the right side of the screen, a little up). 
  648.      When placed correctly, you can either press the LEFT mouse 
  649.      button to set it down, or ALT-INSERT (you may need to do 
  650.      either twice as I've noticed GFA can occaisionaly miss a 
  651.      click).  
  652.      
  653.           Let's make a border (you could mess with its' border 
  654.      while still in movement mode, if you wanted) by pressing the 
  655.      '+' (plus) key once. Now let's increase the horizontal size 
  656.      of the border by pressing the cursor right key twice.      
  657.  
  658.           So we have our buttons' physical appearance in order. 
  659.      What else do we have to do? How about telling DIOX that this 
  660.      is going to be a RADIO button. So go to the 'Attr' drop down 
  661.      and select RADIO. A dialog box pops up and presents you with 
  662.      a choice of five different 'groupings' of radio buttons. 
  663.      Select group 1. Hit return. This button is now a radio button 
  664.      in radio group 1. 
  665.  
  666.           Now let's create the next RADIO button, the one we saw 
  667.      in the example as "Radio A 2". Go to CREATE and select it. 
  668.      Now we have the previous text to edit, as DIOX now has a 
  669.      default to present. ALL menu options will reflect the LAST 
  670.      BUTTON YOU ACTIVATED. We don't have to do a complete re-
  671.      typing in order to get "Radio_A_1" to "Radio_A_2". Press the 
  672.      DOWN cursor button and you're cursor goes to the end of the 
  673.      text line. Hit BACKSPACE once and then press '2'. Hit return.
  674.      From now on, everytime you create a button, it will 
  675.      automatically start off as being picked up.
  676.      
  677.           How about a tip on how to do some precision positioning 
  678.      of buttons? We want a profesional look, yet v0.9 lacks 
  679.      autosnap. No problem. What we want to do is precisley align 
  680.      the new button under our previous one. So, position it 
  681.      approximatley with the mouse just under the other button, the 
  682.      upper edge of its' border should just touch the bottom of the 
  683.      first buttons' border. Next, let go of the mouse and start 
  684.      using the keyboard. Alternate- left cursor or alternate- 
  685.      right cursor will move the button one charcter space left or 
  686.      right. Shifted- alternate- left and right cursors will move 
  687.      left and right one pixel. The same applies for up and down. 
  688.      Now position the new button so its' left and right sides are 
  689.      flush with the old buttons' left and right sides. Use the 
  690.      SHFT-ALT-RIGHT/LEFT for that movement. Use the SHFT-ALT-
  691.      UP/DOWN for precise alignment of the buttons' top edge to the 
  692.      old buttons' bottom edge, so they just touch. Now, you've got 
  693.      the left-right alignment correct, okay? And the two buttons 
  694.      are just touching vertically? Good. NOW, press ALT-DOWN 
  695.      cursor once. You now have the ability to uniformly space 
  696.      buttons, because ALT-Cursor always spaces the same distance. 
  697.      The next button under this one you put a single ALT-DOWN from 
  698.      this button, and so on. It works like that for horizontal, 
  699.      too.
  700.  
  701.           OK, so now your button is precisley in place. So as not 
  702.      to disturb its' position, use the ALT-INSERT button as a 
  703.      substitute for the LEFT mouse click. You may need to do it 
  704.      twice in a row. I use the ALT-CRSR-INSERT keys constantly! 
  705.      They're how I line things up! 
  706.      
  707.           Now we have to edit its' text. Select the STRING option 
  708.      and simply edit "Radio A 1" into "Radio A 2" by the same 
  709.      method as you did with editing by CREATE. Generaly, you may 
  710.      sometimes wish to temporarily lay down a button, change its' 
  711.      text, then pick it up to line it up. That is because your 
  712.      text length may vary, and so will your buttons' border 
  713.      dimensions. In our case, the text size was the same, so our 
  714.      previous alignment was not futile.
  715.      
  716.           How about our most recent buttons' attribute? We 
  717.      haven't messed with that yet. Look at the 'Attr' drop down 
  718.      menu. As you can see, it is already checked-off in front of 
  719.      RADIO. Let's see if our group is still the same. Select 
  720.      RADIO, and there you see that Group 1 is selected already, 
  721.      which is what we want. Press RETURN. You did not HAVE to 
  722.      check the attribute like that, as it was defaulted to that 
  723.      already. I just wanted you to see it for yourself.
  724.      
  725.           Now see if you can make a button whose name is 
  726.      'Radio_a_3' and whose text is "Radio A 3". Position it under 
  727.      the button whose text is "Radio A 2" by one ALT-DOWN length. 
  728.      Remember that its' attribute defaults to radio group 1 if you 
  729.      don't change it, which we don't want to do. Now create 
  730.      another button called 'Radio_a_4' and give it a text line of 
  731.      "Radio A 4". Position it under the button whose text is 
  732.      "Radio A 3" by the length of one ALT-DOWN. All four buttons 
  733.      should now have uniform, even spacing. 
  734.  
  735.           Let's change gears a little. We are now going to make 
  736.      another 'grouping' of radio buttons. Let's only put in three 
  737.      buttons this time. CREATE a button entitled 'Radio_b_1'.
  738.      Give a line of text: "Radio B 1" and position it to the left 
  739.      of the button "Radio A 1". Make it four ALT-RIGHT lengths 
  740.      from the button. NOW, we DO want to make some modification to 
  741.      the attribute, as we are dealing with a different radio 
  742.      group. Can you guess how we will deal with this? Yup. Select 
  743.      RADIO from the drop down, select, oh, Group 4 maybe, (that is 
  744.      what the examples' is) and hit return. Now create a button 
  745.      entitled 'Radio_b_2' and give it text of "Radio B 2" and 
  746.      align it one ALT-DOWN length beneath the "Radio B 1" button. 
  747.      Make one more button called 'Radio_b_3', give it text of 
  748.      "Radio B 3" and put it beneath "Radio B 2" by one ALT-DOWN. 
  749.      Remember, the attributes of the last two buttons default to 
  750.      the previous buttons' if you make no changes. We want no 
  751.      changes from "Radio B 1". 
  752.      
  753.           How about something different? Let's make a TOGGLE 
  754.      button. First, create a button called 'Toggle_1'. Give it 
  755.      text of "Toggle 1" and put it twoards the upper left of the 
  756.      screen. Now, let's select the TOGGLE attribute by selecting 
  757.      TOGGLE from the 'Attr' drop down. Poof! You've got a toggle 
  758.      button. Make a second toggle called 'Toggle_2' and put it one 
  759.      ALT-DOWN beneath 'Toggle_1'. The attribute is still toggle, 
  760.      remember? 
  761.      
  762.           Make two EXIT buttons now. Call one 'Exit_1' and give it 
  763.      text of "Exit 1" and place it several ALT-DOWNS under 
  764.      "Toggle 2". Now select EXIT form the 'Attr' strip. Call the 
  765.      other 'Exit_2' and give it text of "Exit 2" and place it one 
  766.      ALT-DOWN beneath "Exit 1".
  767.  
  768.           How about making a CANCEL button? And we want an ENTER 
  769.      button, too. Create a button called 'Okay' and make its' text 
  770.      "Okay". Position it in the upper middle of the screen. Select 
  771.      an attribute of ENTER. This is going to be a default button, 
  772.      so let's graphically indicate that by pressing '+' a few 
  773.      times, thickening the border. Create a button called 'Cancel' 
  774.      and give it text of "Cancel". Position it below "Okay" a few 
  775.      ALT-DOWNS. Select the attribute of CANCEL. Also, press '-' a 
  776.      few times to get rid of the thicker border. Make it one 
  777.      pixel thick, like the others. 
  778.      
  779.           DETAILS! Where's the titles? How about creating a button 
  780.      called 'Radio_title' with text of "RADIO". Place and center 
  781.      this button above the radio buttons. Remember the example? 
  782.      Select the DEAD attribute. This is just for display. Create a 
  783.      button named 'Toggle_title'. For a text line, let's use a 
  784.      special Atari ST character not found on the keyboard. How? 
  785.      Select STRING. Delete what's there now. Type CONTROL-A. Enter 
  786.      the digit 4. Press a cursor key. There's the RIGHT ARROW 
  787.      symbol, whose ST-ASCII code is 4. Continue to type in 
  788.      "Toggle". Position the button to the right of the toggle 
  789.      buttons. Create a button called 'Exit_title' and give its' 
  790.      text line as in toggles', only type in "Exit" instead of 
  791.      "Toggle". The attribute is still DEAD. 
  792.  
  793.           Shapes and fill patterns. No sweat. How about this. We 
  794.      box in each radio group, then box in the two groups plus the 
  795.      radio title. Select BOX to do that. Start a box corner with 
  796.      mouse right, finish the other corner with mouse left. If you 
  797.      don't like it, press UNDO and whatever the last shape is, it 
  798.      will be deleted (fill pattern counts as a shape). Fill in a 
  799.      pattern between the two small boxes and the big box. Select 
  800.      fill. Then, select a pattern with the right mouse button, 
  801.      start filling with the left mouse button at the appropriate 
  802.      mouse coordinates. How about boxes around TOGGLE and EXIT. Do 
  803.      you remember the example? You can do it. 
  804.      
  805.           That covers the editing. One more thing. To delete a 
  806.      button, you must activate it by either right-mouse clicking 
  807.      on it and laying it down, or by pressing return when the 
  808.      mouse arrow is on top of the button. Then press delete. That 
  809.      offensive button has now gone away. 
  810.      
  811.           Now we are going to save it. Do you want to check all 
  812.      the attributes and stuff first? Did you make mistakes? Go to 
  813.      each button with the mouse arrow on top of it, press return, 
  814.      and look at the strip menu options. If you made a mistake, 
  815.      simply change it. Wnat to check its' name? Select RENAME. 
  816.      Just Return if correct, or edit if it's a mistake. OKAY! 
  817.      Everything is good. SAVE it. Select SAVE. Enter the dialog 
  818.      box name of 'Example_box_1'. Return. Save it as EXAMPLE1.LST 
  819.      (always use .LST). 
  820.      
  821.      
  822.      NOW TO TEST:
  823.      
  824.           Load BOXTEST.BAS from the GFA interpreter. MERGE your 
  825.      EXAMPLE1.LST file. CHANGE the name of "Yourbox" to 
  826.      "Example_box_1". Run it! It BETTER work, right? 
  827.      
  828.      
  829.      GOOD! It works..... Now let's INTERFACE it!
  830.      
  831.           Let's write our own, short program that tests for the 
  832.      various buttons. First, MERGE EXAMPLE.LST or EXAMPLE1.LST.
  833.      Now, merge in DRAW_BTN.BAS. Next, we'll write a DO-LOOP. 
  834.      Let's exit if we select the button called 'Exit_2'. Otherwise 
  835.      we print the buttons chosen and loop around, feeding back 
  836.      what our previous choice was. 
  837.      
  838.      Do
  839.      Cls
  840.        @Example_box (A$,*A$)      !Notice,going IN(A$) 
  841.      Cls
  842.      '                             automatically will be set to 
  843.      '                             coming out(*A$).
  844.        If Instr(A$,"(Radio_a_1)")>0  ! Is 'Radio_a_1' selected?
  845.          Print "RADIO A 1"
  846.        Endif
  847.      '
  848.        If Instr(A$,"(Radio_a_2)")>0  ! Is 'Radio_a_2' selected?
  849.          Print "Radio A 2"
  850.        Endif
  851.      '
  852.        If Instr(A$,"(Radio_a_3)")>0  ! Is 'Radio_a_3' selected?
  853.          Print "RADIO A 3"
  854.        Endif
  855.      '
  856.        If Instr(A$,"(Radio_a_4)")>0  ! Is 'Radio_a_4' selected?
  857.          Print "RADIO A 4"
  858.        Endif
  859.      '
  860.        If Instr(A$,"(Radio_b_1)")>0  ! Is 'Radio_b_1' selected?
  861.          Print "RADIO B 1"
  862.        Endif
  863.      '
  864.        If Instr(A$,"(Radio_b_2)")>0  ! Is 'Radio_b_2' selected?
  865.          Print "RADIO B 2"
  866.        Endif
  867.      '
  868.        If Instr(A$,"(Radio_b_3)")>0  ! Is 'Radio_b_3' selected?
  869.          Print "RADIO B 3"
  870.        Endif
  871.      '
  872.        If Instr(A$,"(Toggle_1)")>0  ! Is 'Toggle_1' selected?
  873.          Print "TOGGLE 1"
  874.        Endif
  875.      '
  876.        If Instr(A$,"(Toggle_2)")>0  ! Is 'Toggle_2' selected?
  877.          Print "TOGGLE 2"
  878.        Endif
  879.      '
  880.        If Instr(A$,"(Exit_1)")>0  ! Is 'Exit_1' selected?
  881.          Print "Exit_1"
  882.        Endif
  883.      '
  884.        Exit If Instr(A$,"(Exit_2)")>0  ! If 'Exit_2' selected,end! 
  885.      Loop
  886.      
  887.      EXPERIMENT!
  888.      
  889.